package com.jy.api.controller;

import com.jy.api.domain.WorkShift;
import com.jy.api.service.WorkshiftService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by hanxi on 2018/9/17.
 */
@Slf4j
@RestController
public class WorkShiftController {

    private WorkshiftService workshiftService;

    @Autowired
    public WorkShiftController(WorkshiftService workshiftService) {
        this.workshiftService = workshiftService;
    }

    @GetMapping(path = "/v1/stores/{storeId}/work-shift/current")
    public WorkShift getCurrentWorkShift(@PathVariable String storeId) {
        return workshiftService.getCurrentByStoreId(storeId);
    }


}
